package reflect.hhh;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo14 {
    public static void main(String[] args) throws Exception{
        Class cls=Class.forName("reflect.Person");
//        Method method=cls.getDeclaredMethod("sayHello");
        Method method=cls.getDeclaredMethod("watchTv");
        boolean mark=method.isAnnotationPresent(AutoRunMethod.class);
        if(mark)
            System.out.println("该方法被标注了AutoRunMethod注解");
        else{
            System.out.println("该方法没有被标注AutoRunMethod注解");
        }
    }
}
